
var PLAY = "PLAY";
var FAST_FORWARD = "FAST_FORWARD";
var REWIND = "REWIND";
var SKIP_FORWARD = "SKIP_FORWARD";
var SKIP_BACKWARD = "SKIP_BACKWARD";
var QUIT = "QUIT";

$(function() {
	$("#p").click(function(){
		sendCommand(PLAY);
	});
	$("#q").click(function(){sendCommand(QUIT);});
	$("#ff").click(function(){sendCommand(FAST_FORWARD);});
	$("#rw").click(function(){sendCommand(REWIND);});
	$("#sf").click(function(){sendCommand(SKIP_FORWARD);});
	$("#sb").click(function(){sendCommand(SKIP_BACKWARD);});

});


function sendCommand(command) {
	var myurl = contextPath + "/command";
	$.ajax({
		type: "POST",
		url: myurl,
		data: {"command" : command}
	});
	
}